GetSchema(String,String[]) Method
In This Topic
Returns schema information for the data source of this System.Data.Common.DbConnection using the specified string for the schema name and the specified string array for the restriction values. Returns schema information of the data source of this VistaDBConnection for the specified schema collectionnName and applying an array of optional restriction values. (Example collections: "RESERVEDWORDS", "COLUMNS", "DATATYPES", "VIEWS", "FOREIGNKEYS")
Syntax
'Declaration
Public Overloads Overrides NotOverridable Function GetSchema( _
ByVal As System.String, _
ByVal () As System.String _
) As System.Data.DataTable
'Usage
Dim instance As VistaDBConnection
Dim collectionName As System.String
Dim restrictionValues() As System.String
Dim value As System.Data.DataTable
value = instance.GetSchema(collectionName, restrictionValues)
public override System.Data.DataTable GetSchema(
System.string ,
System.string[]
)
Parameters
- collectionName
- Specifies the name of the schema to return.Specifies the name of the schema to return.
- restrictionValues
- Specifies a set of restriction values for the requested schema.Values to restrict for this lookup. See MSDN docs for more help on restricting collections.
Return Value
A System.Data.DataTable that contains schema information.A DataTable that contains schema information.
Exceptions
Exception | Description |
System.ArgumentException | collectionName is specified as null. |
Example
<<code lang="C#">> using (VistaDBConnection cn = new VistaDBConnection("Data Source=|DataDirectory|Database1.vdb6;")) { cn.Open(); DataTable schema = cn.GetSchema("FOREIGNKEYS"); foreach (DataRow dr in schema.Rows) { foreach (DataColumn dc in schema.Columns) { Console.WriteLine(dc.ColumnName + " = " + dr[dc].ToString()); } } } <</code>>
Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
See Also